import request from '../utils/request';

// 获取财务概览
export const getFinanceOverview = () => {
  return request({
    url: '/finance/overview',
    method: 'GET'
  });
};

// 获取收入趋势
export const getRevenueTrend = (period = 30, type = 'daily') => {
  return request({
    url: '/finance/revenue-trend',
    method: 'GET',
    params: { period, type }
  });
};

// 获取台球桌收入分析
export const getTableAnalysis = () => {
  return request({
    url: '/finance/table-analysis',
    method: 'GET'
  });
};

// 获取时段收入分析
export const getHourlyAnalysis = () => {
  return request({
    url: '/finance/hourly-analysis',
    method: 'GET'
  });
};

// 获取月度收入对比
export const getMonthlyComparison = () => {
  return request({
    url: '/finance/monthly-comparison',
    method: 'GET'
  });
};

// 获取用户消费排行
export const getUserSpending = (limit = 10) => {
  return request({
    url: '/finance/user-spending',
    method: 'GET',
    params: { limit }
  });
};

// 获取收入统计报告
export const getRevenueReport = (startDate, endDate) => {
  return request({
    url: '/finance/revenue-report',
    method: 'GET',
    params: { start_date: startDate, end_date: endDate }
  });
};

// 获取台球桌类型收入分布
export const getTableTypeRevenue = () => {
  return request({
    url: '/finance/table-type-revenue',
    method: 'GET'
  });
};

// 获取支付状态统计
export const getPaymentStatus = () => {
  return request({
    url: '/finance/payment-status',
    method: 'GET'
  });
};
